//
//  GHTabbarViewController.m
//  GodHorses
//
//  Created by Mac on 2017/11/14.
//  Copyright © 2017年 stoneobs@icloud.com. All rights reserved.
//

#import "GHTabbarViewController.h"
#import "GHHomeViewController.h"
#import "GHBusinessViewController.h"
#import "GHMineViewController.h"
#import "GHStudyViewController.h"
#import "GHRebateViewController.h"
#import "GHPartnerViewController.h"
@interface GHTabbarViewController ()

@end

@implementation GHTabbarViewController

- (instancetype)init
{
    self = [super init];
    if (self) {
        [self configNav];
        self.tabBar.backgroundColor = GH_BlackBackGroundColor;
        self.tabBar.barTintColor = GH_BlackBackGroundColor;
        [[UITabBarItem appearance] setTitleTextAttributes:@{NSFontAttributeName : [UIFont fontWithName:@"Helvetica-Bold" size:11.f], NSForegroundColorAttributeName : [UIColor colorWithRed:219/255.0 green:184/255.0 blue:103/255.0 alpha:1]} forState:UIControlStateNormal];
        [[UITabBarItem appearance] setTitleTextAttributes:@{ NSForegroundColorAttributeName:[UIColor colorWithRed:255/255.0 green:239/255.0 blue:188/255.0 alpha:1]} forState:UIControlStateSelected];
    }
    return self;
}
- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
}

- (void)configNav{
    
    GHNavgationViewController *homeNav = [[GHNavgationViewController alloc] initWithRootViewController:[GHHomeViewController new]];
    UIImage * homeSelsetedImage = [[UIImage imageNamed:@"tabbar_home_selected"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    UIImage * homeNormalImage = [[UIImage imageNamed:@"tabbar_home"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    homeNav.tabBarItem = [[UITabBarItem new] initWithTitle:@"首页" image:homeNormalImage selectedImage:homeSelsetedImage];
    
    GHNavgationViewController *productNav = [[GHNavgationViewController alloc] initWithRootViewController:[GHStudyViewController new]];
    UIImage * studySelsetedImage = [[UIImage imageNamed:@"tabbar_classroom_selected"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    UIImage * studuNormalImage = [[UIImage imageNamed:@"tabbar_classroom"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    productNav.tabBarItem = [[UITabBarItem new] initWithTitle:@"健康讲堂" image:studuNormalImage selectedImage:studySelsetedImage];
    
    
//    GHNavgationViewController *detailNav = [[GHNavgationViewController alloc] initWithRootViewController:[GHBusinessViewController new]];
//    UIImage * busSelsetedImage = [[UIImage imageNamed:@"tabbar_distribution_selected"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
//    UIImage * busNormalImage = [[UIImage imageNamed:@"tabbar_distribution"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
//    detailNav.tabBarItem = [[UITabBarItem new] initWithTitle:@"财富分销" image:busNormalImage selectedImage:busSelsetedImage];
//
//    GHNavgationViewController *rebeatNav = [[GHNavgationViewController alloc] initWithRootViewController:[GHRebateViewController new]];
//    UIImage * rebSelsetedImage = [[UIImage imageNamed:@"dividend_selected"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
//    UIImage * rebNormalImage = [[UIImage imageNamed:@"dividend"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
//    rebeatNav.tabBarItem = [[UITabBarItem new] initWithTitle:@"分红返利" image:rebNormalImage selectedImage:rebSelsetedImage];
    
        GHNavgationViewController *patenarNav = [[GHNavgationViewController alloc] initWithRootViewController:[GHPartnerViewController new]];
        UIImage * rebSelsetedImage = [[UIImage imageNamed:@"dividend_selected"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
        UIImage * rebNormalImage = [[UIImage imageNamed:@"dividend"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
        patenarNav.tabBarItem = [[UITabBarItem new] initWithTitle:@"合作商家" image:rebNormalImage selectedImage:rebSelsetedImage];
    
    GHNavgationViewController *mineNav = [[GHNavgationViewController alloc] initWithRootViewController:[GHMineViewController new]];
    UIImage * mySelsetedImage = [[UIImage imageNamed:@"tabbar_personal_center_selected"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    UIImage * myNormalImage = [[UIImage imageNamed:@"tabbar_personal_center"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    mineNav.tabBarItem = [[UITabBarItem new] initWithTitle:@"我的" image:myNormalImage selectedImage:mySelsetedImage];
    
    //self.viewControllers = @[homeNav,productNav,detailNav,rebeatNav,mineNav];
    self.viewControllers = @[homeNav,productNav,patenarNav,mineNav];
}


@end
